package com.yenlien.traceyun.business.controller.response;

import com.yenlien.traceyun.business.entity.WarehousePart;
import org.springframework.expression.spel.ast.NullLiteral;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-12-22
 * @description:
 **/
public class WarehousePartView {

    private String id;

    private String name;

    private String warehouseId;

    private String basesoilId;

    private String warehouse;

    private String basesoild;

    public static WarehousePartView create(WarehousePart part) {
        WarehousePartView view = new WarehousePartView();
        view.setId(part.getId());
        view.setName(part.getName());
        view.setWarehouseId(part.getWarehouseId());
        return view;
    }

    public static List<WarehousePartView> create(List<WarehousePart> parts) {
        List<WarehousePartView> views = new ArrayList<>();
        if (parts != null && parts.size() > 0) {
            for (WarehousePart part : parts) {
                views.add(create(part));
            }
        }
        return views;
    }

    public String getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(String warehouseId) {
        this.warehouseId = warehouseId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWarehouse() {
        return warehouse;
    }

    public void setWarehouse(String warehouse) {
        this.warehouse = warehouse;
    }

    public String getBasesoild() {
        return basesoild;
    }

    public void setBasesoild(String basesoild) {
        this.basesoild = basesoild;
    }

    public String getBasesoilId() {
        return basesoilId;
    }

    public void setBasesoilId(String basesoilId) {
        this.basesoilId = basesoilId;
    }
}
